import Vue from 'vue'
import App from './App'
import Api from '@/utils/api.js'
import noApi from '@/utils/no-api.js'

import uView from "uview-ui";

const WaitModel = (title)=>{
	uni.showLoading({
		title: title,
		mask: true
	});
}
const HideWaitModel = (title)=>{
	uni.hideLoading();
}
const prePage = ()=>{
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}
const successMsg = (title)=>{
	uni.showToast({
		title:title,icon:'success',mask:true,duration: 3000
	});
}
const errorMsg = (title)=>{
	uni.showToast({ title:title, icon: 'none' });
}

Vue.config.productionTip = false;
Vue.prototype.$websiteUrl = 'http://yc.tengshemall.com';
Vue.prototype.$api = {prePage,WaitModel,HideWaitModel,successMsg,errorMsg};
Vue.prototype.api = Api
Vue.prototype.noApi = noApi
Vue.use(uView);
App.mpType = 'app';

const app = new Vue({
    ...App
})
app.$mount()

